What is PassthroughSubject & CurrentValueSubject

I think we can make analogies with real world cases.

PassthroughSubject = A doorbell push button
// for button action

When someone rings the door, you are notified only if you are at home (you are the subscriber)

PassthroughSubject doesn’t have a state, it emits whatever it receives to its subscribers.

CurrentValueSubject = A light switch Someone turns on the lights in your home when you are outside. You get back home and you know someone has turned them on.
// for slider or tabbar

CurrentValueSubject has an initial state, it retains the data you put in as its state.

Reference

https://stackoverflow.com/questions/60482737/what-is-passthroughsubject-currentvaluesubject
https://www.youtube.com/watch?v=n9r3pHypWjk&ab_channel=iCode